package com.lzw.breezeNovel.WebAdmin.controller;

import com.lzw.breezeNovel.WebAdmin.service.AdvertFreeService;
import com.lzw.breezeNovel.common.result.Result;
import com.lzw.breezeNovel.model.entity.pojo.novel.AdvertFree;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin")
public class AdvertFreeController {

    /**
     * 注入AdvertFreeService
     */
    @Resource
    private AdvertFreeService advertFreeService;

    /**
     * 查询所有的广告
     */
    @GetMapping("/advertFree")
    public Result<List<AdvertFree>> queryAdvertFree(){
        List<AdvertFree> advertFree = advertFreeService.queryAdvertFree();
        return Result.ok(advertFree);
    }
}
